module model.main;

import model.imodel;
import utils.log;
debug import std.stdio;

// COMPILER_BUG_3252: package methods are not virtual
import model.model;

int main(string[] args) {
    Log.message("Application start");
    auto mainModel = IModel.getInstance();
    if (!(cast(shared Model) mainModel).init(args)) {
        Log.message("Cannot start Idelight");
        return 1;
    }
    (cast(shared Model) mainModel).run();
    scope(success) {
        Log.message("Application exit normally");
    }
    scope(failure) {
        Log.message("Application exit with errors");
    }
    return 0;
}
